package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.ICompanyDao;
import com.cn.wanxi.dao.impl.CompanyImpl;
import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.service.ICompanyService;

import java.util.List;

public class CompanyServiceImpl implements ICompanyService {
    @Override
    public int add(CompanyModel companyModel) {
        ICompanyDao iCompanyDao = new CompanyImpl();
        return iCompanyDao.add(companyModel);
    }

    @Override
    public int update(CompanyModel companyModel) {
        ICompanyDao iCompanyDao = new CompanyImpl();
        return iCompanyDao.update(companyModel);
    }

    @Override
    public int del(CompanyModel companyModel) {
        ICompanyDao iCompanyDao = new CompanyImpl();
        return iCompanyDao.del(companyModel);
    }

    @Override
    public List<CompanyModel> findAll() {
        //调用数据接口层
        ICompanyDao iCompanyDao = new CompanyImpl();
        return iCompanyDao.findAll();
    }

    @Override
    public CompanyModel findById(CompanyModel companyModel) {
        ICompanyDao iCompanyDao = new CompanyImpl();
        return iCompanyDao.findById(companyModel);
    }

    @Override
    public List<CompanyModel> findBySome(CompanyModel companyModel) {
        ICompanyDao iCompanyDao = new CompanyImpl();
        return iCompanyDao.findBySome(companyModel);
    }
}
